Conversation
…ed_domains - Add ensureLocalhostDomains helper functions in parser and workflow packages - Modify mcp.go to preserve localhost/127.0.0.1 when custom domains are specified - Modify compiler.go to preserve localhost/127.0.0.1 when custom domains are specified - Update existing tests to expect localhost domains alongside custom domains - Add comprehensive tests for the new helper functions - Manual verification shows fix working correctly in compiled workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ed_domains Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] make sure localhost, 127.0.0.1 is in the allowed domains of playwright, even when the user provides custom allowed domains.
Fix: Ensure localhost domains are always included in Playwright allowed_domains
Sep 16, 2025
pelikhan
approved these changes
Sep 16, 2025
This was referenced Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When users specified custom
allowed_domainsfor Playwright tools, the localhost domains (localhostand127.0.0.1) were completely replaced instead of being preserved alongside the custom domains. This broke local development and testing workflows.Before (broken behavior):
Result:
"github.com,*.github.com"❌ (localhost access lost)After (fixed behavior):
Result:
"localhost,127.0.0.1,github.com,*.github.com"✅ (localhost preserved)Root Cause
The issue existed in two locations where custom domains completely overwrote the default localhost domains:
pkg/parser/mcp.go(lines 177, 179-186): MCP configuration parserpkg/workflow/compiler.go(line 3029): Workflow compilation logicBoth locations used direct assignment instead of merging domains.
Solution
Added
ensureLocalhostDomainshelper functions that intelligently merge localhost domains with custom domains:localhostand127.0.0.1are already present in the custom domainsTesting
Impact
This fix ensures that Playwright workflows maintain localhost access for local development and testing while respecting user-defined custom domains. The change is backward compatible and enhances both security and functionality.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.contoso.com/tmp/go-build3267414842/b279/cli.test -test.testlogfile=/tmp/go-build3267414842/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)/tmp/go-build997092829/b279/cli.test -test.testlogfile=/tmp/go-build997092829/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)/tmp/go-build71345873/b279/cli.test -test.testlogfile=/tmp/go-build71345873/b279/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.